/**
 * IDE: Eclipse
 * 
 * @author Justin Niles
 * @author Grant Foster
 * @author Bryce Langlotz
 * @author Max Honosky
 *
 */
public class Point
{
    public int xpos;
    public int ypos;
    public int zpos;

    public Point(int xpos, int ypos, int zpos)
    {
        this.xpos = xpos;
        this.ypos = ypos;
        this.zpos = zpos;
    }

    public boolean equals(Object object2)
    {

        if ((this.getClass().equals(object2.getClass())) && (object2 != null))
        {

            Point otherLocation = (Point)object2;
            if (this.x() == (otherLocation.x())
                && this.y() == (otherLocation.y())
                && this.z() == (otherLocation.z()))
            {
                return true;
            }
        }

        return false;
    }

    public Point east()
    {
        int newx = this.x() + 1;
        Point newPoint = new Point(newx, this.y(), this.z());
        return newPoint;
    }

    public Point north()
    {
        int newy = this.y() + 1;
        Point newPoint = new Point(this.x(), newy, this.z());
        return newPoint;
    }

    public Point south()
    {
        int newy = this.y() - 1;
        Point newPoint = new Point(this.x(), newy, this.z());
        return newPoint;
    }

    public Point west()
    {
        int newx = this.x() - 1;
        Point newPoint = new Point(newx, this.y(), this.z());
        return newPoint;
    }

    public Point up()
    {
        int newz = this.z() + 1;
        Point newPoint = new Point(this.x(), this.y(), newz);
        return newPoint;
    }

    public Point down()
    {
        int newz = this.z() - 1;
        Point newPoint = new Point(this.x(), this.y(), newz);
        return newPoint;
    }


    public int x()
    {
        return this.xpos;
    }

    public int y()
    {
        return this.ypos;
    }

    public int z()
    {
        return this.zpos;
    }

}
